package com.chushouya.manager.dto.admin.finance;

import com.chushouya.manager.constants.AccountUserTypeEnum;
import com.chushouya.manager.constants.SettleBizInAndOutEnum;
import com.chushouya.manager.constants.SettleBizTypeEnum;
import com.chushouya.manager.constants.TradeStatusEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
@ApiModel("资金账户明细")
public class FinanceAccountRecordDTO {

    @ApiModelProperty("ID")
    private Long recordId;

    @ApiModelProperty("账户ID")
    private Long accountId;

    @ApiModelProperty("结算用户ID")
    private Long accountUserId;

    @ApiModelProperty("结算用户名称")
    private String accountUserName;

    @ApiModelProperty("账户用户类型【0回收商/1门店】")
    private Integer accountUserType;

    @ApiModelProperty("业务类型")
    private Integer bizType;

    @ApiModelProperty("交易前余额")
    private BigDecimal beforeAmount;

    @ApiModelProperty("交易金额")
    private BigDecimal tradeAmount;

    @ApiModelProperty("交易后余额")
    private BigDecimal afterAmount;

    @ApiModelProperty("收入/支出")
    private Integer inOrOut;

    @ApiModelProperty("关联业务单号")
    private String bizNo;

    private String bizRemark;

    @ApiModelProperty("交易外部流水号")
    private String outTradeNo;

    @ApiModelProperty("交易流水号")
    private String tradeNo;

    @ApiModelProperty("交易状态")
    private Integer tradeStatus;

    @ApiModelProperty("交易状态")
    private String tradeStatusText;

    @ApiModelProperty("交易时间")
    private Date tradeTime;

    @ApiModelProperty("交易备注")
    private String tradeRemark;

    @ApiModelProperty("账户用户类型【0回收商/1门店】")
    private String accountUserTypeText;

    @ApiModelProperty("结算账户类型【1余额结算/2直付通钱包】")
    private String accountTypeText;

    @ApiModelProperty("业务类型")
    private String bizTypeText;

    public Integer getInOrOut() {
        return SettleBizInAndOutEnum.getInOrOut(this.bizType);
    }

    public String getAccountUserTypeText() {
        return AccountUserTypeEnum.getDesc(this.accountUserType);
    }

    public String getBizTypeText() {
        return SettleBizTypeEnum.getDesc(this.bizType);
    }

    public String getTradeStatusText() {
        return TradeStatusEnum.getDesc(this.tradeStatus);
    }
}
